package textapp.connector.model;

public class GroupUserModel {

	private int id;
	
	private GroupModel group;
	
	private UserModel user;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public GroupModel getGroup() {
		return group;
	}

	public void setGroup(GroupModel group) {
		this.group = group;
	}

	public UserModel getUser() {
		return user;
	}

	public void setUser(UserModel user) {
		this.user = user;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof GroupUserModel)) {
			return false;
		}
		GroupUserModel other = (GroupUserModel) obj;
		if (other.getId() == 0) {
			return false;
		}
		return this.group.equals(other.getGroup()) && this.user.equals(other.getUser());
	}
}
